1. Field of the Invention
The present invention relates to an image processing apparatus, an image processing method, and a computer program. More particularly, the present invention relates to an image processing apparatus, an image processing method, and a computer program that make it possible to obtain high-quality images in a digital still camera and the like.
2. Description of the Related Art
For example, when a user photographs an image with a digital still camera or the like held by the hand, if an exposure time inevitably becomes long because an amount of light is insufficient, an image photographed by the digital still camera may be blurred because of hand shake. In order to prevent such a blurred image from being formed, there is a method of obtaining an image without a blur by, so to speak, superimposing plural dark images continuously photographed with an exposure time short enough for preventing the image from being affected by hand shake (see, for example, JP-A-2005-38396).
In the method disclosed in JP-A-2005-38396, plural times of photographing are temporally continuously performed by a digital still camera to obtain temporally continuous plural photographed images as plural input images. With one of the plural photographed images set as a reference image, overall movements of the respective plural photographed images with respect to the reference image are calculated. Positioning of the plural photographed images is performed on the basis of the movements. One image (an output, image) is obtained by superimposing (combining) the plural photographed images after the positioning.
FIG. 1 snows a method of obtaining an output image in the case in which there are two photographed images.
In FIG. 1, two photographed images P1 and P2 are photographed images continuously photographed by a digital still camera. In the photographed images P1 and P2, positions of subjects deviate from each other because of hand shako or the like.
When, for example, the photographed image P1 of the two photographed images P1 and P2 is set as a reference image, movements of the respective photographed images P1 and P2 with respect to the reference image are calculated. Positioning of the photographed images P1 and P2 is performed on the basis of the movements to superimpose the subjects in the two photographed images P1 and P2. An output image Pout is obtained by super imposing the photographed images P1 and P2 after the positioning.
In this case, the plural photographed images are photographed with a short exposure time. However, the plural photographed images may foe photographed with proper exposure. When the plural photographed images are photographed with the proper exposure and superimposed as described above, it is possible to obtain an output image with a high S/N (signal to Noise ratio).
When the positioning of the plural photographed images is performed and the plural photographed images after the positioning are superimposed to generate one output image as described above, positions of pixels of the plural photographed images after the positioning do not always coincide with positions of pixels of the output image.
Therefore, if a pixel for which a pixel value is calculated among the pixels of the output image is referred to as pixel of interest, superimposition of the plural photographed images after the positioning is performed by interpolating the pixel value of the pixel of interest using, among the pixels of the plural photographed images (hereinafter also referred to as photographed pixels as appropriate) after the positioning, pixel values of photographed pixels in positions near the position of the pixel of interest.
Examples of a method of the interpolation of the pixel value of the pixel of interest include a method of performing a simple addition for directly adding up pixel values of one or more photographed pixels in positions near the position of the pixel of interest and a method of performing interpolation using pixel values of one or more photographed pixels in positions near the position of the pixel of interest and an interpolation function.
The interpolation function is a function that changes according to a relative position of the photographed pixel used for the interpolation with respect to the pixel of interest of (a distance between the pixel used for the interpolation and the pixel of interest). For example, a linear function represented by a primary expression, a cubic function, and the like are used. The simple addition is equivalent to using a function with a value of 1 as the interpolation function regardless of the (relative) position of the photographed pixel used for the interpolation.